
function showMapForHotel(hotelId, hotelLatitude, hotelLongitude){
	console.log($('#map'+hotelId));
	console.log(hotelLatitude);
	console.log(hotelLongitude);

	$('#map'+hotelId).jHERE({
        enable: ['behavior', 'zoombar'],
        center: [hotelLatitude, hotelLongitude],
        zoom: 14,
        type: 'map',
        appId: '69Dgg78qt4obQKxVbRA8',
        authToken: 'Nz7ilIB_v1CRwPXxgPdvuA'
    }).jHERE('marker', [hotelLatitude, hotelLongitude], {
    	icon: 'http://jhere.net/images/pin-black.png',
        anchor: {
        	x: 12,
        	y: 32
        },
        click: function(){
        	alert('Go to hotel details TODO');
        }
    });
}

var toggleDetails = function(field, id) {
	var details = field, last = $('div.last-active');
	if (details.hasClass('hidden')) {
		if (last.length == 0) {
			details.removeClass('hidden').addClass('active').addClass(
					'last-active');
		} else {
			last.removeClass('active').addClass('hidden');
			details.removeClass('hidden').addClass('active').addClass(
					'last-active');
		}
	} else if (details.hasClass('active')) {
		details.removeClass('active').addClass('hidden');
	} else {
		details.addClass('active');
	}
	$('html,body').animate({
		scrollTop : $("#" + id).offset().top - 45
	}, 500);

}, getHotelInfo = function(url, data, field) {
    /*if (field.html().toString().trim().length === 0) {*/
        $.ajax({
            type: "POST",
            url: url,
            data: data,
            headers: {},
            success: function(data, textStatus, jqXHR) {
                /*field.html(data);*/
            	console.log("Data:");
            	console.log(data);
            },
            error: function(jqXHR, textStatus, errorThrown) {
                console.log(jqXHR);
                console.log(textStatus);
                console.log(errorThrown);
            }
        });
   /* }*/
};